package org.kfive.nova.design.behavior.interpreter;

/**
 * Created by admin on 2017-02-20.
 */
public class AddNonterminalExpression extends NonterminalExpression {
    private Expression firstExpression;
    private Expression secondExpression;

    public AddNonterminalExpression(Expression firstExpression, Expression secondExpression) {
        this.firstExpression = firstExpression;
        this.secondExpression = secondExpression;
    }

    @Override
    public Object interpreter(Context context) {
        return (Integer)this.firstExpression.interpreter(context)+(Integer)this.secondExpression.interpreter(context);
    }
}
